/*
 * testTextbox.cpp
 *
 *  Created on: Sep 22, 2011
 *      Author: nicoabie
 */
#include "../src/SDLtoolkit/widgets/Textbox.h"
#include "../src/common/utils/Logger.h"

void testTextbox() {

	SDLEngine* engine = new SDLEngine();

	engine->start();

	Textbox* textBox = new Textbox(engine->getMainSurface(), 20, 20);

	Event* event = new Event();

	bool quit = false;
	while (quit == false) {
		while (engine->pullEvent(event)) {

			textBox->handleEvent(*event);
			//handle event de los widgets

			engine->refreshScreen();
			if (event->getType() == Quit) {
				quit = true;
			}
		}
	}
	cout<<"contenido de textBox: "<<textBox->getInput()<<endl;

	delete(textBox);

	engine->stop();

	Logger::log("Tests", "textbox",	"Finalizado.");
}
